<?php

class Tools_OAUrls {

    private static $instance;

    public static function get_instance() {
        if(!self::$instance) {
            self::$instance = new Tools_OAUrls();
        }
        return self::$instance;
    }

    /**
     * userdetail/?uid=1&ym=201206
     */
    public function build_user_detail_url($uid,$time = 0,$type=1) {
        $url = APF::get_instance()->get_config('base_domain');
        if(!empty($uid)){
            $de = $type==1 ? 'userdetail' : 'userdetail2';
            $url = $url.'/'.$de.'/?uid='.$uid.'&ym='.$time;
        }
        return $url;
    }
    //请假详细信息
    public function build_leave_detail_url($lid){
        $url = APF::get_instance()->get_config('base_domain');
        if(!empty($lid)){
            $url = $url.'/applydetail/?id='.$lid;
        }
        return $url;
    }
    //打印预览页
    public function build_print_view_url($lid){
        $url = APF::get_instance()->get_config('base_domain');
        if(!empty($lid)){
            $url = $url.'/tripprint/?id='.$lid;
        }
        return $url;
    }
    //审批列表
    public function build_audit_list(){
        $url = APF::get_instance()->get_config('base_domain');
        return $url."/audit/";
    }
    //已审批列表
    public function build_unaudit_list(){
        $url = APF::get_instance()->get_config('base_domain');
        return $url."/unaudit/";
    }
    public function build_print_url_list($lid){
        $url = APF::get_instance()->get_config('base_domain');
        return $url."/tripprint/?id=".$lid;
    }
    //我的申请页面
    public function build_myapply_url(){
        $url = APF::get_instance()->get_config('base_domain');
        return $url."/myapply/";
    }
    private function __clone(){

    }
    private function __construct() {

    }
}
?>
